package com.zmn.brs.common.constant;

import java.util.UUID;

/**
 * 描述： 定时任务常量
 * @author chongw
 * @since 2021-06-10 17:13
 */
public class TaskConst {

    public static final String TASK_ID_BRS_SCENE = "brsSceneJob:";

    public static final String TASK_ID_BRS_SCENE_PUSH = "brsScenePushJob:";

    public static final String TASK_ID_BRS_DATA_PREPARATION = "brsDataPreparation";

    public static final String TASK_ID_BRS_DATA_COMPARISON = "brsDataComparison";

    public static final String TASK_ID_BRS_DATA_QUANTITY_PUSH = "brsDataComparisonPush";

    public static final String TASK_ID_BRS_ENGINEER_UNPAID_PUSH = "brsEngineerUnpaidPush";

    public static final String TASK_ID_BRS_ENGINEER_SALES = "brsEngineerSales";

    public static final String SCENE_ID = "sceneId";

    public static final String JOB_TYPE = "jobType";

    public static final String[] MONTH_DEFAULT_TIME = { "23", "50", "00"};

    public static final String SALES_DEFAULT_TIME = "21:00:00";

    public static final String getBrsSceneObjectiveTaskId(Integer sceneId,Object jobType){
        return TaskConst.TASK_ID_BRS_SCENE + sceneId + ":" + jobType;
    }

    public static final String getBrsSceneObjectivePushTaskId(Integer sceneId,Object jobType){
        return TaskConst.TASK_ID_BRS_SCENE_PUSH + sceneId + ":" + jobType;
    }

    public static final String getBrsSceneTaskId(String taskShard , Integer sceneId,Object jobType){
        return taskShard + sceneId + ":" + jobType;
    }

    public static final String getBrsSceneJobType(Integer sceneId, Object jobType){
        return "brs:task:version:" + sceneId + ":" + jobType;
    }

    /**
     * 计算任务版本号
     * @param taskId
     * @return
     */
    public static final String getBrsSceneTaskVersion(String taskId){
        return String.valueOf(UUID.randomUUID().toString().hashCode());
        //return taskId + ":" + DateUtil.getNowFormatted(DateUtil.FORMAT_DATETIME2);
    }
}
